import request from './request'
import { useUserStore } from "../store/modules/user"
// 保存厂商充值
export function saveRecharge(data: object) {
    let token = {
        [useUserStore().row.tokenName]: useUserStore().token
    }
    return request({
        url: '/factory/recharge/saveRecharge',
        method: 'post',
        data,
        headers: token
    })
}

// 获取充值明细列表
export function getRechargeDetailList(data) {
    let token = {
        [useUserStore().row.tokenName]: useUserStore().token
    }
    return request({
        url: '/factory/recharge/getRechargeDetailList',
        method: 'post',
        headers: token,
        data
    })
}
// 取消充值
export function getGoodsTypeSelect(data,id) {
    let token = {
        [useUserStore().row.tokenName]: useUserStore().token
    }
    return request({
        url: '/factory/recharge/cancelRecharge/'+id,
        method: 'post',
        headers: token,
        data
    })
}
// 去充值
export function toRecharge(id) {
    let token = {
        [useUserStore().row.tokenName]: useUserStore().token
    }
    return request({
        url: '/factory/recharge/toRecharge/'+id,
        method: 'get',
        headers: token,
    })
}